

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>多彩气质宝贝-国际化儿童早教机构</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="__PUBLIC__/css/base.css" type="text/css" rel="stylesheet" />
<link type="text/css" rel="Stylesheet"
	href="__PUBLIC__/css/blog/main.css" />

<script src="__PUBLIC__/js/jquery.js" type="text/javascript"></script>
<script src="__PUBLIC__/ueditor/editor_all.js" type="text/javascript"></script>
<script src="__PUBLIC__/ueditor/editor_config.js" type="text/javascript"></script>

<link rel="stylesheet" type="text/css"
	href="__PUBLIC__/ueditor/themes/default/ueditor.css" />

<script type="text/javascript">
		function save(type){
			
			if($('#title').val()=="" || $('#title').val().length==0){
				alert("文章标题不能为空，请重新输入！");
				$('#title').focus();
				return ;
			}
			if($('#title').val().length>30){
				alert("文章标题不能超过三十个字符，请重新输入！");
				$('#title').focus();
				return ;
			}
				$.post('__URL__/insert/',
		    	    {	
						'content':editor.getContent(),
						'title':$('#title').val(),
						'commentright':$("input[name='radComment']:checked").val(),
						'summary':$('#summary').val(),
						'type':type
			    	},
					    function(data){
							alert(data.info);
							window.location = "__APP__/LoginUser/index/type/"+type ;
					    },
				    'json');	
			
				    
		}


		function update(type){			
			$tempId = '' ;
			if('{$vo['id']}'!=''){
				tempId = '{$vo['id']}' ;
			}			
			$.post('__URL__/update/',
		    	    {	
	    	    		'id':tempId,
						'content':editor.getContent(),
						'title':$('#title').val(),
						'commentright':$("input[name='radComment']:checked").val(),
						'summary':$('#summary').val()
						//'status':type
			    	},
					    function(data){
							alert(data.info);
							window.location = "__APP__/LoginUser/index/type/blog" ;
					    },
				    'json');
		}
		
</script>



</head>

<body onload="menu0display()">




<include file="./Tpl/default/Index/header.html" />


<div id="wrap">

<div class="head">

<div class="user_info">

<dl>

	
	<ul>
		<li class="user_name"><span>{$_SESSION[C('USER_AUTH_KEY')]}</span></li>

		<li class="feed_link"><a href="__APP__/LoginUser/index/type/blog">我发布的博客</a>|<a
			href="__APP__/LoginUser/index/type/appraise">我发布的评价</a></li>
	</ul>
	
</dl>

</div>

<div style="float: right; margin-top: 20px; color: Red;"></div>

</div>
<table width="90%" border="0">
  <tr>
    <td width="150" align="right" valign="top" class="p5"><if condition=" ${type} eq 'blog' ">
	<p class="subtit">文章标题：</p>
<else/>
	<p class="subtit">评价标题：</p>
</if></td>
    <td valign="top" class="p5"><input type="text" id="title" value="{$vo['title']}"
	style="width: 560px; height: 20px; float: left;" maxlength="100" /></td>
  </tr>
  <tr>
    <td width="150" align="right" valign="top" class="p5"><if condition=" ${type} eq 'blog' ">
	<p class="subtit">文章摘要：</p>
<else/>
	<p class="subtit">评价摘要：</p>
</if></td>
    <td valign="top" class="p5"><textarea rows="5" cols="50" id="summary">{$vo['summary']}</textarea></td>
  </tr>
  <tr>
    <td width="150" align="right" valign="top" class="p5"><p id="p_comment" class="subtit">是否允许评论：</p></td>
    <td valign="top" class="p5">	<div id="d_comment" class="radioBox">
	<if
		condition="$vo['commentright'] eq 1"> <input type="radio"
		name="radComment" id="radComment2" value="1" checked="checked" /><label
		for="radComment2">允许评论</label> <input type="radio" name="radComment"
		id="radComment1" value="0" /><label for="radComment1">禁止评论</label> <else />
	<input type="radio" name="radComment" id="radComment2" value="1" /><label
		for="radComment2">允许评论</label> <input type="radio" name="radComment"
		id="radComment1" value="0" checked="checked" /><label for="radComment1">禁止评论</label>
	</if>
	</div></td>
  </tr>
  <tr>
    <td width="150" align="right" valign="top" class="p5"><p class="subtit">文章内容：</p></td>
    <td valign="top" class="p5">
    		<div class="section">
	    		<script type="text/plain" id="myEditor">
				{$vo['content']}	
			</script>
				<script type="text/javascript">
				    var editor = new baidu.editor.ui.Editor();   			   
				    editor.render('myEditor');
				    editor.focus();
				</script>
			</div>

<div class="btn_area_1 mT10">
	<if condition="( empty($vo['id']) )">
		<input id="btnPublish" type="button" class="input_btn_1" value="发表文章"
		title="保存并跳转" onclick="save('{$type}');" /> 
	<else /> <input
		id="btnPublish" type="button" class="input_btn_1" value="更新文章"
		title="保存并跳转" onclick="update('{$type}');" /> 
	</if> 
</div></td>
  </tr>

</table>


</body>
<include file="./Tpl/default/Index/footer.html" />
</html>

